home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d2 / pmap21.arc / PMAP.DOC < prev    next >
Text File  |  1991-07-12  |  49KB  |  1,067 lines

  1.  
  2.                                    PMAP 2.10
  3.                                    ---------
  4.  
  5.         PMAP (Program MAP) displays how your PC's memory is being used.
  6.         It lists all active programs (including resident programs such
  7.         as Sidekick and PCED), displays free memory areas and their
  8.         locations, identifies device drivers, summarizes expanded (EMS)
  9.         and extended (XMS) memory use, and details certain DOS data
  10.         areas.
  11.  
  12.         Version 2.10 adds support for XMS (extended memory) and the HMA
  13.         (high memory area).  We have found that the old switch syntax
  14.         was becoming unworkable (PMAP was designed in the good old days
  15.         when memory was memory), so we decided to bite the bullet and
  16.         change the way some of the options work.  Some switches have
  17.         been renamed to conform with current terminology (/X was for
  18.         expanded memory, is now for XMS memory) and some usage has been
  19.         changed.  For example, /S used to mean "display ONLY standard
  20.         memory"; no, it means "display standard memory in addition to
  21.         anything else that's selected."  We apologize to anyone who has
  22.         to change batch files, etc., but we felt that the changes were
  23.         necessary.
  24.  
  25.         | identifies information about new features for PMAP 2.0.
  26.  
  27.         Syntax summary
  28.         --------------
  29.         The command line syntax of PMAP is:
  30.  
  31.             pmap [program-list] [/options]
  32.  
  33.         The default behavior, if no arguments are supplied, is:
  34.  
  35.             PMAP /e /s /x       (or, yes, PMAP /sex)
  36.  
  37.         The program-list, if present, restricts the display of resident
  38.         programs to those listed; the list may include wildcards (*).
  39.         The program list affects the standard memory display only.  See
  40.         "Standard memory display", below.
  41.  
  42.       | The option switches are:
  43.       |
  44.       |     Select primary displays(s):
  45.       |         /e   display expanded (EMS) memory summary
  46.       |         /k   display data area of DOS kernel (DOS 3.0 or later)
  47.       |         /r   display raw list of memory blocks
  48.       |         /s   display standard DOS memory
  49.       |         /v   display device driver information
  50.       |         /x   display extended (XMS) memory summary
  51.       |
  52.       |     Additional options for /s display (these all imply /s):
  53.       |         /d   display detail list of allocation by programs
  54.       |         /f   display names of open files (DOS 3.0 or later)
  55.       |         /n   display programs' environments
  56.       |
  57.       |     Othe options:
  58.       |         /q   quick display
  59.       |         ?   display syntax summary
  60.  
  61.         Multiple switches may be specified together or separately.  All
  62.         of these are valid and equivalent:
  63.  
  64.             pmap /f /d
  65.             pmap /fd
  66.             pmap /f/d
  67.  
  68.         If you wish to set "permanent" options, i.e., options that will
  69.         be in effect for every PMAP run, set an environment variable
  70.         called PMAP to contain the desired option switches.  For
  71.         example, if you usually want to list only standard memory, with
  72.         file handles, set PMAP as follows:
  73.  
  74.             SET PMAP=/s /f
  75.  
  76.         To override options set in the PMAP variable, you can follow
  77.         any switch with an asterisk.  For example, if you have the PMAP
  78.         variable set as above but do NOT want to see the file handles
  79.         for one run, use:
  80.  
  81.             pmap /f*
  82.  
  83.  
  84.       | Selecting the primary display(s)
  85.       | --------------------------------
  86.       | PMAP provides six primary displays:
  87.       |
  88.       |     - standard (conventional) DOS memory (/s option)
  89.       |     - expanded (EMS) memory (/e)
  90.       |     - extended (XMS) memory (/x)
  91.       |     - the system kernel (/k)
  92.       |     - device drivers (/v)
  93.       |     - raw statndard memory blocks (/r)
  94.       |
  95.       | By default, PMAP displays the first three; as mentioned above,
  96.       | you can change the default with the PMAP environment variable.
  97.       |
  98.       | The first occurrence of any of the above options, either on the
  99.       | command line or in the PMAP variable, turns off all of the
  100.       | others.  Thus, if you type
  101.       |
  102.       |     pmap /sk
  103.       |
  104.       | You will see only the standard memory and kernel displays--the
  105.       | EMS and XMS displays are turned off.  Similarly, if you use
  106.       |
  107.       |     SET PMAP=/e
  108.       |
  109.       | you will, by default, see only the expanded (EMS) memory
  110.       | display.
  111.       |
  112.       | Primary options set on the command line turn off any primary
  113.       | options set in the PMAP variable:
  114.       |
  115.       |     SET PMAP=/s
  116.       |     ...
  117.       |     pmap /x
  118.       |
  119.       | In the example, only extended memory is displayed.
  120.       |
  121.       | Note that the /d, /f, and /n options all imply /s, since they
  122.       | affect only the standard memory display.  Thus,
  123.       |
  124.       |     pmap /d
  125.       |
  126.       | is equivalent to
  127.       |
  128.       |     pmap /sd
  129.       |
  130.       | and will display only standard memory (including the details
  131.       | requested by /d).
  132.  
  133.  
  134.         Standard memory display
  135.         -----------------------
  136.         The display of standard (conventional) DOS memory looks similar
  137.         to this:
  138.  
  139.  
  140.           Addr Program   Parent    Parameters     Han Blks   Size    Vectors
  141.           ---- -------  -------- ---------------  --- ----  -------  -------
  142.           147D command  command  main               0    2     3888  2E
  143.           157B nmi      command  /i/q               0    2     1856  02
  144.           15F2 cache-em command  500                0    2    13168  13 19
  145.           193E dbase    command  /C d:command      16    2   238384  30
  146.           ...
  147.           Other allocated blocks                         4    81296
  148.           Total conventional free memory                 4   451696
  149.           Largest conventional free block                    371168
  150.           Next program will load at 5579
  151.  
  152.         Each program that is currently in memory is displayed.  Fields
  153.         are as follows:
  154.  
  155.             Addr        The memory segment at which the program is
  156.                         loaded, in hexadecimal.  If an asterisk (*)
  157.                         follows the address, the program is loaded
  158.                         into a disconnected high memory chain (see
  159.                         below).
  160.  
  161.             Program     The name of the program, if available.  "n/a"
  162.                         indicates that the name is not available.  The
  163.                         program name is never available under DOS 2.x.
  164.  
  165.             Parent      The name of the program's "parent".  In most
  166.                         cases, this will be "command", because most
  167.                         programs are run by COMMAND.COM (i.e., from
  168.                         the DOS prompt).  See below.
  169.  
  170.             Parameters  The command line parameters that were specified
  171.                         when the program was run.  Some programs re-use
  172.                         the area where the parameters are stored, in
  173.                         which case a "??" will be displayed.  An
  174.                         ellipsis ("...") at the end indicates that there
  175.                         were more parameters than could fit here.
  176.  
  177.             Han         The number of open handles (or files) associated
  178.                         with the owner.  See below.
  179.  
  180.             Blocks      The number of memory blocks that are owned by
  181.                         the program.
  182.  
  183.             Size        The total size of all blocks owned by the
  184.                         program.
  185.  
  186.             Vectors     A list of 80x8x interrupt vectors that appear to
  187.                         have been "intercepted" by the program.
  188.  
  189.         In the example, the program NMI is loaded at memory segment
  190.         157BH and was run directly from the DOS prompt or from a batch
  191.         file.  The original parameters were "/i/q".  DOS has allocated
  192.         two blocks of memory for the program, and they total 1856 bytes
  193.         in size.  Vector 2 (nonmaskable interrupt) has been
  194.         "intercepted" by NMI.
  195.  
  196.         "Other allocated blocks" refer to blocks of memory that are not
  197.         free but also are not owned by any executable program that PMAP
  198.         can identify.  They may be owned by device drivers or by DOS
  199.         itself; or they may in fact be owned by executable programs but
  200.         not indicated as such.  PMAP may be able to make an educated
  201.         guess as to the true owner; if so, the probable name of the
  202.         program will be indicated in parentheses when you use the /D
  203.         option switch (see below).
  204.  
  205.         At the end of the list, PMAP indicates the number of blocks of
  206.         free memory, the total size of all free blocks, the largest
  207.         single free block, and the segment address at which the next
  208.         program will probably load.
  209.  
  210.         You can restrict the display to certain programs by naming them
  211.         on the command line.  For example, the command
  212.  
  213.             pmap sdump ced
  214.  
  215.         would display information for the SDUMP and CED programs, and no
  216.         others.
  217.  
  218.         You can use a single wildcard '*' at the end of any named
  219.         program in the list.  For example,
  220.  
  221.             pmap sd* c*
  222.  
  223.         would display information for all programs beginning with
  224.         "sd" or "c".
  225.  
  226.         NOTE:  "below" the first program loaded in memory (usually
  227.         COMMAND.COM), there is a block of memory allocated by DOS for
  228.         device drivers, etc.  PMAP does not show this block in the
  229.         main display; its size is indicated under "Other allocated
  230.         blocks" area if you request a detailed listing (/D), and further
  231.         detail is available with the /K switch (see below).
  232.  
  233.  
  234.         Detail display (/D)
  235.         -------------------
  236.         When you run PMAP with the /D (Detail) option, you'll see the
  237.         same display, except that PMAP will show a detailed list of
  238.         memory blocks allocated for each program.  For example:
  239.  
  240.          Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  241.          ---- ------- -------- ------------- --- ---- ------- -------
  242.          1666 kbfix2  command  /KT1 /D0...     0    2    2560 08 09 16
  243.          1661  Environment                                 64
  244.          1666  Program                                   2496
  245.  
  246.         KBFIX2 has two memory blocks allocated to it; PMAP shows the
  247.         size of each block and its address, and makes an educated guess
  248.         as to what the block is used for.
  249.  
  250.         You may include a list of specific programs to be displayed:
  251.  
  252.             pmap sdump ced /d
  253.  
  254.         PMAP also displays a detail list of all free blocks of memory
  255.         and of "other allocated blocks".
  256.  
  257.  
  258.         Environment display
  259.         -------------------
  260.         If you add a /N switch, PMAP will display the contents of each
  261.         program's environment (if there is one).  For example, the
  262.         command:
  263.  
  264.             pmap rxrun /n
  265.  
  266.         might display something like this:
  267.  
  268.          Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  269.          ---- ------- -------- ------------- --- ---- ------- -------
  270.          B6D4  rxrun  command                  0    2    1536
  271.          Environment [B7E3]
  272.            COMSPEC=C:\COMMAND.COM
  273.            PATH=C:\UTIL;C:\DOS
  274.            PROMPT=$p$g
  275.            [name] C:\BOOT\RXRUN.COM
  276.  
  277.         The [B7E3] represents the segment address at which the
  278.         environment is located.
  279.  
  280.         The [name] field appears only under DOS 3.0 and later; it shows
  281.         the contents of the area of the environment where the full path
  282.         and name of the program are stored.  In some cases (especially
  283.         in the case of COMMAND.COM), garbage may in fact be stored in
  284.         this area.  If PMAP think that the field is invalid, it will
  285.         report "[name field invalid]"; however, PMAP may display invalid
  286.         data if the contents of the field look like displayable characters.
  287.  
  288.  
  289.         Open files display (/F)
  290.         -----------------------
  291.         If the HAN field in the standard display is non-zero, the named
  292.         program currently has files that are open.  You can display the
  293.         names of these files by adding the /F option.  For example:
  294.  
  295.          Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  296.          ---- ------- -------- ------------- --- ---- ------- -------
  297.          12CD  command  command  /f            1    2  4176  22 23 24 2E
  298.          Open files: D:FOPT.TXT
  299.  
  300.         This feature is available only under DOS 3.0 and later and is
  301.         mutually exclusive with the /Q (Quick) switch.
  302.  
  303.  
  304.         Quick display (/Q)
  305.         ------------------
  306.         Some of what PMAP does can be somewhat time consuming on slower
  307.         computer systems, and one task may fail under some versions of
  308.         DOS.  If you would like PMAP to run slightly faster (about 1/2
  309.         second on a 4.77Mhz machine if you have EMS) or if PMAP fails
  310.         with an error message similar to:
  311.  
  312.                 pmap: error tracing buffer chain
  313.  
  314.         then use the /Q (Quick) option switch.  With /Q set, PMAP will
  315.         not:
  316.  
  317.             1. Search for a disconnected high memory chain, or
  318.             2. Look for buffers, files, stacks, etc.
  319.  
  320.         The /K and /F options cannot be used with /Q.  Also note that /Q
  321.         will have little effect on PMAP's speed unless you have expanded
  322.         memory (EMS), and that /Q is automatically set for DOS versions
  323.         prior to 3.0.
  324.  
  325.         Remember, if you always want to use the /Q switch, you can
  326.  
  327.             SET PMAP=/Q
  328.  
  329.         in your environment.
  330.  
  331.  
  332.         Kernel display (/K)
  333.         -------------------
  334.         Below the first program loaded into memory (usually COMMAND.COM)
  335.         there is an area of memory used by DOS for storage of code and
  336.         data.  This area is broken into three major sections:
  337.  
  338.             1. IBMBIO's code and data.  This is always located at memory
  339.             segment 0070h and contains the basic code and data for
  340.             system input/output services.  The default device drivers
  341.             (for the printer, screen, and keyboard, etc.) are also
  342.             located here.
  343.  
  344.             2. IBMDOS's basic code and data.  This is located in memory
  345.             immediately following IBMBIO's area and contains the "guts"
  346.             of DOS.  This area usually includes space for five FILES
  347.             and one BUFFER.  (Under DOS 5.0 with DOS=HIGH, part of this
  348.             area is moved to the HMA.)
  349.  
  350.             3. A supplementary DOS data area.  This area may include:
  351.                 - your FCBs; the size is affected by the FCBS option
  352.                   in your CONFIG.SYS.
  353.                 - any FILES beyond the initial number (usually 5) that
  354.                   are stored in the IBMDOS area.  This size of this area
  355.                   is determined by the FILES option in CONFIG.SYS.
  356.                 - any BUFFERS beyond the initial number (usually 1) that
  357.                   are stored in the IBMDOS area.  The size of this area
  358.                   is determined by the BUFFERS option in CONFIG.SYS.
  359.                 - your logical drive table.  There is one entry in this
  360.                   table for each drive up to LASTDRIVE.
  361.                 - your DOS STACKS, if any (DOS 3.1 or later only).  The
  362.                   size of this area is determined by the STACKS option
  363.                   in CONFIG.SYS.
  364.                 - any externally loaded device drivers such as ANSI.SYS.
  365.  
  366.         To display a detailed map of the complete DOS memory area (all
  367.         three of the above), use the /K option.  The display might look
  368.         something like this:
  369.  
  370.            MCB Addr  End   Size  Contents
  371.           ---- ---- ----  -----  --------
  372.            --  0070 0279   8352  IBMBIO [includes 13 device drivers]
  373.            --  027A 09C7  29920  IBMDOS [includes 5 files, 1 buffer]
  374.           09C8 09C9 1282  35760  DOS data/drivers
  375.  
  376.           DOS data/drivers area detail:
  377.                09C9 0E9B  19760    8 device drivers (PMAP /V for detail)
  378.                0E9C 0F10   1872   35 files
  379.                0F11 0F1E    224    4 FCBs
  380.                0F1F 1191  10032   19 buffers
  381.                1192 11B5    576    7 logical drives
  382.                11B6 1282   3280    9 stacks (128 bytes each)
  383.  
  384.         The first section shows the locations and sizes of the three
  385.         major areas used by DOS.  In this case, for example, area 2 (the
  386.         basic IBMDOS code/data area) begins at memory segment 027Ah and
  387.         is 29,920 bytes in size.  It includes five files and one buffer.
  388.  
  389.         The MCB field, which only appears for area 3, shows the address
  390.         of the memory control block for the area.  This is part of DOS's
  391.         memory management scheme and is decribed in greater detail later
  392.         in this manual.  Areas 1 and 2 are not part of DOS's official
  393.         memory chain, so they have no MCBs.
  394.  
  395.         The second section breaks down the contents of area 3 in greater
  396.         detail.  In the example system, eight device drivers are
  397.         loaded and the system is configured as follows:
  398.  
  399.                 FILES=40
  400.                 BUFFERS=20
  401.                 LASTDRIVE=G
  402.                 STACKS=9,128
  403.                 FCBS=4,0
  404.  
  405.         The display shows the exact location and size of each of these
  406.         items.  For example, the extra 19 buffers (there's one in area
  407.         2, leaving 19 of the 20 for area 3) are located at memory
  408.         segment 0F1Fh and extend through the end of memory segment
  409.         1191h, a total of 10,032 bytes.
  410.  
  411.         If you use an extender program such as QEMM's FILES.COM to
  412.         increase the number of FILES after bootup, storage for the extra
  413.         files will be located elsewhere in the memory chain--not in
  414.         any of the DOS data areas described.  PMAP will display such
  415.         areas in a separate section if there are any.  For example, if
  416.         we ran:
  417.  
  418.             FILES + 2
  419.  
  420.         to increase the maximum number of files from 40 to 42, the
  421.         display might appear as follows:
  422.  
  423.             Additional memory block(s) used for DOS data:
  424.              MCB Addr  End   Size  Contents
  425.             ---- ---- ----  -----  --------
  426.             1897 1898 18C8    784
  427.               >> 18C1 18C7    112   2 files
  428.  
  429.         This shows that the 944-byte block from 1403h to 143Dh (with MCB
  430.         at 1402h) is used for supplementary DOS data.  Within this
  431.         944-byte allocation, the 272 bytes from memory segments 142Ch
  432.         through 143Ch contain the actual storage for information about
  433.         the five files.
  434.  
  435.         Note also that, if there are additional blocks such as these,
  436.         they are identified in the standard program display if you use
  437.         the /D (detail) option.  The above might look something like
  438.         this in the detail display:
  439.  
  440.          Addr Program  Parent    Parameters  Han Blks  Size   Vectors
  441.          ---- ------- -------- ------------- --- ---- ------- -------
  442.          1898 n/a     command  +2              0    1     784
  443.          1898   2 files                                   784
  444.  
  445.         The /K option is available only under DOS 3.0 and later.
  446.  
  447.  
  448.         Raw display (/R)
  449.         ----------------
  450.         When you run PMAP with the /R (Raw) parameter, you'll see a
  451.         display like this:
  452.  
  453.             T  MCB  Addr  Owner  Para    Bytes
  454.             - ----  ----  -----  ----  --------
  455.             M 0974  0975   0008  0AFA     44960
  456.             M 146F  1470   1470  00C3      3120
  457.             M 1533  1534   1470  0020       512 GLVMGR
  458.                [more of the same]
  459.             M 1DF3  1DF4   1DF4  0706     28768
  460.             M 24FA  24FB   2500  0004        64 [pmap]
  461.             M 24FF  2500   2500  1376     79712 [pmap]
  462.             Z 3876  3877   0000  6789    424080
  463.  
  464.         This is an uninterpreted list of all blocks of memory allocated
  465.         by DOS (see below).  The fields are as follows:
  466.  
  467.             Type        The block type.  There are only two block types,
  468.                         type M and type Z.  The last block in the
  469.                         chain is type Z, and all others are type M.
  470.  
  471.             MCB         The segment address of the Memory Control Block
  472.                         (sometimes known as an arena header).
  473.  
  474.             Addr        The segment address of the memory block itself.
  475.                         This is always equal to the MCB address plus
  476.                         one.
  477.  
  478.             Owner       The segment address of the program that "owns"
  479.                         the block of memory.  If this is 0000, the block
  480.                         is unallocated or "free".
  481.  
  482.             Para        The size of the block, in paragraphs (16 bytes).
  483.  
  484.             Bytes       The size of the block, in bytes.
  485.  
  486.         All numbers are hexadecimal except "bytes", which is decimal.
  487.  
  488.         The [pmap] suffix after an allocated block indicates that the
  489.         block is being used by PMAP.  When PMAP terminates, this block
  490.         will be free (unallocated).  The standard (non-raw) PMAP display
  491.         understands this, and displays the map as if PMAP weren't there.
  492.  
  493.         Following some lines on the display you may see a one- to
  494.         eight-character string:
  495.  
  496.             T  MCB  Addr  Owner  Para    Bytes
  497.             - ----  ----  -----  ----  --------
  498.             M 1533  1534   1470  0020       512 GLVMGR
  499.  
  500.         Under DOS 4.0 and later, a program name may appear in the last
  501.         eight bytes of a memory control block (which is what the raw
  502.         display is showing).  Under DOS versions prior to 4.0, DOS does
  503.         not place the program name in this location, but some other
  504.         programs (such as 386MAX and QEMM) may do so.  If PMAP thinks
  505.         that the contents of the last eight bytes of the MCB look like a
  506.         readable string, it will display the string.  This may provide
  507.         some information about the owner of the block.  In some cases,
  508.         the information in this area may be garbage that happens to
  509.         consist of all ASCII characters--and these will be displayed.
  510.         You should be able to tell at a glance which strings are
  511.         meaningful and which are not.
  512.  
  513.         If PMAP is able to identify a disconnected high memory chain, it
  514.         will display the line:
  515.  
  516.             Disconnected high memory chain:
  517.  
  518.         between the regular low-RAM DOS memory chain and the "hidden"
  519.         high memory chain.
  520.  
  521.         If the /R switch is included, all other command line parameters
  522.         are ignored.
  523.  
  524.  
  525.         Expanded memory display (/E)
  526.         ----------------------------
  527.         If expanded (LIM or EEMS) memory is present and you have not
  528.         specified /E*, PMAP displays EMS allocation as follows:
  529.  
  530.             Expanded memory summary:
  531.  
  532.                     Block      Size    Name
  533.                     -----    -------   ----
  534.                     0         589824   SYSTEM
  535.                     1         425984
  536.                     2          16384   CDIR
  537.                     3          65536   HINDSITE
  538.                     ...
  539.                     Free      327680
  540.                     Total    2097152
  541.                     Page frame segment: CC00h
  542.  
  543.         The NAME field will be present only if your expanded memory
  544.         manager supports the LIM 4.0 specification, and then only for
  545.         programs that have defined their names to the system.
  546.  
  547.         EMS memory uses a "page frame" that maps a 64K block (actually,
  548.         four 16K "pages") of EMS memory into standard 80x8x memory.
  549.         The segment to which this memory is mapped is also displayed.
  550.  
  551.  
  552.       | Extended memory display (/X)
  553.       | ----------------------------
  554.       | If extended memory (XM) is present and you have not specified
  555.       | the /X* option, PMAP displays XM information as follows:
  556.       |
  557.       |     Extended memory summary:
  558.       |
  559.       |       INT 15 ext mem available               0
  560.       |       XMS version                         3.00 (vendor 5.12)
  561.       |       HMA                              enabled, in use
  562.       |       Free XMS                          458752
  563.       |       Largest free block                458752
  564.       |
  565.       |       XMS handles in use:
  566.       |           Handle      Size  Address   LkCt
  567.       |           1          32768  00110000    1
  568.       |           2         277504  00118000   --
  569.       |
  570.       | "INT 15 ext mem" refers to AT-style extended memory that is not
  571.       | managed by an XMS driver.  This type of memory is used primarily
  572.       | by older devices such as VDISK.
  573.       |
  574.       | The remaining information is shown only if an XMS (eXtended
  575.       | Memory Specification) driver is present in the system.  XMS
  576.       | drivers manage extended memory by allocating and providing
  577.       | access to blocks of XM as requested by system and application
  578.       | programs.  Among such drivers are DOS's HIMEM.SYS, Qualitas's
  579.       | 386MAX, and Quarterdeck's QEMM.
  580.       |
  581.       | "XMS version" is the version number of XM Specification that is
  582.       | supported by your XMS driver.  Following this is the vendor's
  583.       | internal version number for the driver software.
  584.       |
  585.       | "HMA" refers to the High Memory Area, a block of memory
  586.       | approximately 64K in size at the very top of your CPU's real
  587.       | mode address space.  The HMA is special because it includes the
  588.       | only addresses above 1MB that can be accessed by the CPU in real
  589.       | mode (which is the mode DOS normally uses).  Current XMS
  590.       | managers allocate this space to one, and only one, program at a
  591.       | time.  HMA is the are of memory that is used by DOS 5.0 when
  592.       | DOS=HIGH is specified (thus moving most of DOS out of the lower
  593.       | 640K).  PMAP's report shows whether or not the HMA is enabled
  594.       | and, if so, whether or not it is in use.
  595.       |
  596.       | "Free XMS" shows the total amount of XMS-managed extended memory
  597.       | that is current available for allocation, in bytes.  "Largest
  598.       | free block" shows the size of the largest single free block of
  599.       | XMS-managed memory.
  600.       |
  601.       | If any XMS-managed memory is currently allocated, the "XMS
  602.       | handles in use" section displays additional information.  For
  603.       | each active XMS "handle" (each block of extended memory
  604.       | allocated by the XMS manager is assigned a handle), PMAP
  605.       | displays the handle number, the size of the block in bytes, and
  606.       | the 32-bit linear address of the block (in hex).  If the block
  607.       | is currently "locked" (guaranteed not to move), PMAP displays
  608.       | its non-zero "lock count", which is the number of times it must
  609.       | be unlocked before it is once again movable.  Most blocks should
  610.       | be unlocked most of the time.
  611.  
  612.  
  613.         Device driver display (/V)
  614.         --------------------------
  615.         If you execute PMAP with the /V switch, it will display a table
  616.         of information about your installed device drivers.  No other
  617.         data (i.e., no memory maps) are displayed when /V is selected.
  618.  
  619.         The first five columns of the table contain the following
  620.         fields:
  621.  
  622.             Name        If the device is a character device, the device
  623.                         name.  If it is a block device (like a disk),
  624.                         this will be "Blk (n)", where n is the number
  625.                         of units handled by this device.
  626.  
  627.             Address     The address where the device driver begins in
  628.                         memory, in standard hex segment:offset form.
  629.  
  630.             Size        The approximate size (in bytes, displayed in
  631.                         decimal) of the device driver.  See below.
  632.  
  633.             Strt        The entry point of the driver's strategy
  634.                         routine.  This is the hex offset within the
  635.                         device driver's segment (shown under ADDRESS).
  636.  
  637.             Intr        The entry point of the driver's interrupt
  638.                         routine.  This is the hex offset within the
  639.                         device driver's segment (shown under ADDRESS).
  640.  
  641.         The remaining columns are bit fields with the driver's attribute
  642.         record.  In each case, an asterisk indicates that the bit is
  643.         set (1), and a space indicates that it is reset (0).
  644.  
  645.             CHR         *    = this is a character device
  646.                         <sp> = this is a block device.
  647.  
  648.             IOC         *    = device supports IOCTL calls
  649.  
  650.             IBM    for block devices:
  651.                         *    = non-IBM format
  652.                    for character devices:
  653.                         *    = supports output-until-busy
  654.  
  655.             RMV         *    = supports removable media
  656.  
  657.             LOG         *    = supports Get/Set Logical Device
  658.  
  659.             CLK         *    = this is the clock device
  660.  
  661.             NUL         *    = this is the NUL device
  662.  
  663.             SOT         *    = this is this standard output device
  664.  
  665.             SIN    for block devices:
  666.                         *    = supports generic IOCTL
  667.                    for character devices
  668.                         *    = this is the standard input device
  669.  
  670.         Note that <space> implies the opposite of <*>; for example, an
  671.         asterisk in IOC indicates that the device supports IOCTL calls,
  672.         while a space there indicates that IOCTL is not supported.
  673.  
  674.         Also note that DOS does not provide any documented way for
  675.         programs to find the chain of device drivers.  If PMAP is unable
  676.         to find the chain, it will tell you so.
  677.  
  678.  
  679.         Device driver size; order of list
  680.         ---------------------------------
  681.         PMAP cannot reliably determine the size of the default devices
  682.         (CON, PRN, AUX, COM1, etc.) that are loaded automatically by DOS
  683.         (they share code and data).  These will all show an address
  684.         beginning with "0070", and their sizes will not be displayed.
  685.         However, if you load a replacement for one of these devices (for
  686.         example, ANSI.SYS loads a replacement for CON), PMAP will
  687.         generally be able to determine and display its size.
  688.  
  689.         The devices are shown in the order in which DOS searches for
  690.         them.  If there are two or more devices with the same name, the
  691.         one that DOS will use is the first one listed.  For example, you
  692.         will have two or more CON devices if you use ANSI.SYS; the
  693.         ANSI.SYS CON will be listed before the default CON.  DOS will
  694.         use the first one listed (ANSI.SYS).
  695.  
  696.  
  697.         Disconnected high memory chains
  698.         -------------------------------
  699.         DOS manages memory by using a "chain" of allocated memory blocks
  700.         as described below.  This chain normally ends at the 640K mark
  701.         (segment A000), as memory addresses above this address are
  702.         reserved for use by video adapters (some programs such as
  703.         EEMRAM, QEMM, and 386MAX may extend the chain to B000 or B800).
  704.         By following the links in this chain, PMAP is able to map your
  705.         DOS memory and determine what programs own what areas of memory.
  706.  
  707.         However, Quarterdeck's QEMM and Qualitas' 386MAX may create an
  708.         additional chain of allocated memory blocks in "high RAM" above
  709.         the video adapter memory area.  Using a "high load" feature,
  710.         these programs can load your resident utilities and device
  711.         drivers into the high RAM chain, thus increasing the memory
  712.         available to DOS in low RAM.
  713.  
  714.         The high RAM chain is not connected to DOS's standard low RAM
  715.         chain (unless you use 386MAX's OPENHIGH option), and versions of
  716.         PMAP prior to 2.0 would not find it; therefore programs loaded
  717.         into high RAM were not displayed.
  718.  
  719.         Beginning with version 2.0, however, PMAP attempts to locate
  720.         these "high memory chains" and identify the programs loaded
  721.         there.  If PMAP succeeds in finding the chain and there are
  722.         programs loaded in it, such programs will be marked with an
  723.         asterisk (*) in the program display.  In raw block display mode
  724.         (/R), the two chains (low and high) are shown separately.
  725.  
  726.         NOTE:  PMAP has no internal knowledge of QEMM, 386MAX, or
  727.         similar programs; the presence of high memory chains is
  728.         determined empirically.  The possibility exists that PMAP may
  729.         occasionally report an artifact chain: something that looks to
  730.         PMAP like a high memory chain but really isn't.  You should be
  731.         able to tell by looking at the displays (especially the /R raw
  732.         display) if such a chain has been found.
  733.  
  734.  
  735.         Interrupt vectors
  736.         -----------------
  737.         Many times interrupts are "intercepted" by more than one
  738.         resident program.  PMAP will only show a vector attached to the
  739.         LAST program that intercepted it.  For example, in the sample
  740.         display shown for the /D (Detail option), KBFIX2 shows that it
  741.         has intercepted vectors 8, 9, and 16.  However, RXINTMGR and
  742.         SDUMP could also have intercepted any or all of these three
  743.         vectors, and PMAP would not know about that.
  744.  
  745.         PMAP assumes that any vector that points into memory owned by a
  746.         program has been intercepted by that program.  That is not
  747.         always true, so you may occasionally see spurious vectors
  748.         attached to a program.
  749.  
  750.  
  751.         More about parents
  752.         ------------------
  753.         Every program has a "parent"; if program B was executed by
  754.         program A, then A is B's parent.  In most cases, the parent will
  755.         be COMMAND.COM, because most PC programs are executed by
  756.         COMMAND.COM.
  757.  
  758.         However, any program can execute any other program (assuming
  759.         that there is sufficient memory, etc.).  This is how "shells"
  760.         work.  For example, current versions of WordPerfect and many
  761.         other programs allow you to "exit to DOS"; what they usually do
  762.         is execute COMMAND.COM, which then displays a DOS prompt and
  763.         allows you to enter any commands that you wish.  If you run
  764.         PMAP, you will see two copies of COMMAND.COM in memory.
  765.  
  766.         However, you may notice that the second copy of COMMAND.COM
  767.         shows COMMAND.COM as its parent.  Logically, you would expect
  768.         the parent to be (in this case) WordPerfect.  Unfortunately,
  769.         some versions of COMMAND.COM (the one that comes with DOS 3.2,
  770.         for example) fool around with the area of memory that PMAP uses
  771.         to find the parent's address; rather than having the parent's
  772.         address, COMMAND.COM puts its own address there.  In effect,
  773.         COMMAND.COM is always its own parent.
  774.  
  775.         In general, programs that allow you to execute other programs
  776.         can use one of two methods:  they can execute the other programs
  777.         directly, or they can execute COMMAND.COM and ask it to run the
  778.         requested program.  If the former case, PMAP will show the true
  779.         parent; if the latter, PMAP may show COMMAND.COM as the parent,
  780.         and COMMAND.COM will be its own parent.
  781.  
  782.         Here is part of a PMAP display that shows a direct-execution
  783.         under DOS 3.2:
  784.  
  785.             Addr  Program    Parent   Han  Blks    Size    Vectors
  786.             ----  -------   --------  ---  ----   -------  -------
  787.             ...
  788.             3222  xced      command     0     2     26016
  789.             387E  qe        xced        0     3     97232
  790.             503E  command   command     0     3      3488  22 23 24
  791.             ...
  792.  
  793.         The XCED program was run by COMMAND.COM (from the DOS prompt).
  794.         It then ran the program QE directly, i.e., without reloading
  795.         COMMAND.COM; QE's parent is correctly shown as XCED.  Finally,
  796.         a "shell" exit was taken from QE, which did reload COMMAND.COM;
  797.         notice that COMMAND shows as its own parent.  The second
  798.         COMMAND.COM's real parent is QE, but this is not shown
  799.         correctly.
  800.  
  801.  
  802.         File handles
  803.         ------------
  804.         The "Han" field of the standard memory display shows the number
  805.         of file handles that are associated with each program.  For the
  806.         most part, this field will be zero.  Some open handles may show
  807.         for programs that are active (for example, the active program
  808.         named "dbase" in the first example has 16 open files).
  809.  
  810.         Use the /F option to see the names of the open files.
  811.  
  812.         You may see some resident programs that show one or more open
  813.         handles.  This usually occurs when you redirect the program's
  814.         start-up logo to NUL, and the program fails to close its
  815.         standard files before exiting back to DOS (this really shouldn't
  816.         be necessary, but it is).  These open handles may reduce the
  817.         number of files your application programs can have
  818.         simultaneously open.  We prefer not to redirect programs' logos
  819.         to NUL.  We save file handles; we get to see the names of the
  820.         nice people who wrote our software, and their copyrights; and we
  821.         don't lose the error messages that explain why the program isn't
  822.         doing what we thought it should.  Sounds like a bargain.
  823.  
  824.  
  825.         Multi-tasking/task-switching programs
  826.         -------------------------------------
  827.         ... play havoc with the memory allocation chain.  PMAP may
  828.         not yield very much useful information under such programs.
  829.  
  830.  
  831.         DOS's memory allocation chain
  832.         -----------------------------
  833.         This information is almost totally undocumented by Microsoft, so
  834.         take it for what's it's worth.  It's provided for informational
  835.         purposes only, and could vary from DOS version to DOS version.
  836.         However, the basic structure of the memory allocation scheme has
  837.         remained unchanged from DOS 2.0 through the version that is
  838.         current as of this date (5.0).  Only the program name field has
  839.         changed--it was added with version 4.0.
  840.  
  841.         DOS (version 2.0 or later) manages memory as a chain of "blocks"
  842.         or "arenas".  Each block begins on a paragraph boundary, can be
  843.         (in theory) almost a megabyte in size, and is preceded
  844.         immediately by a 16-byte Memory Control Block (MCB), sometimes
  845.         known as an "arena header".  The lowest (the 80x8x interrupt
  846.         vectors, BIOS and DOS data areas, DOS itself, device drivers,
  847.         etc.) and highest (video buffers, ROM modules) portions of
  848.         memory are not mapped, but the rest of memory is.  Thus, memory
  849.         can be pictured like this:
  850.  
  851.             paragraph   contents
  852.             ---------
  853.               0000      low memory (unmapped)
  854.                         first MCB (16 bytes)
  855.                         first memory block
  856.                         next MCB
  857.                         next memory block
  858.                         ...
  859.                         last MCB
  860.                         last memory allocation block
  861.               nnnn      end of DOS memory (640K, for example)
  862.  
  863.         The address of the first MCB will vary, depending on your
  864.         version of DOS and the number and size of device drivers,
  865.         buffers, stacks, etc., that you loaded via CONFIG.SYS.  In all
  866.         current versions of DOS (verified through 5.00), the segment
  867.         address of the first MCB can be obtained via DOS function 52H.
  868.         On return from this function, the address of the first MCB is
  869.         located at ES:[BX-2].  Here is sample code that returns the
  870.         address of the first MCB in AX:
  871.  
  872.             mov ah,52H
  873.             int 21H
  874.             mov ax,es:[bx-2]
  875.  
  876.         The MCB itself is a 16-byte region of memory that with fields as
  877.         follows:
  878.  
  879.             Offset  Size    Contents
  880.             ------  ----    --------
  881.             0       Byte    'M': this is not the last MCB
  882.                             'Z': this is the last MCB
  883.                             anything else: memory control blocks
  884.                             destroyed.  DOS will politely crash.
  885.  
  886.             1       Word    The segment address of the program that owns
  887.                             this block of memory (the program's PSP).
  888.  
  889.             3       Word    The size of the block, in paragraphs
  890.  
  891.             5-7             Reserved
  892.  
  893.             8-15     n/a    8-char (blank-filled) name of owner program
  894.                             (DOS 4.0+ only)
  895.  
  896.         This structure provides all of the information needed to step
  897.         through the memory allocation chain.  A basic algorithm is as
  898.         follows:
  899.  
  900.             Set MCB = segment of first MCB (as described above)
  901.             Do Until byte (MCB:0) = 'Z'
  902.                 If byte (MCB:0) isn't 'M' or 'Z',
  903.                     Then there's a big problem (the system is about
  904.                     to crash with a "memory allocation error")
  905.                 Block_owner = word (MCB:1)
  906.                 Block_size = word (MCB:3)
  907.                 MCB = MCB + block_size + 1
  908.             End
  909.  
  910.         EMS and XMS memory is not mapped by DOS.
  911.  
  912.         For more complete detail about DOS's memory allocation, see
  913.         "Managing Memory" by William J. Redmond in PC Tech Journal,
  914.         August, 1984 (Vol. 2, No. 2).
  915.  
  916.         Version 2.10 (7/3/91)
  917.         ---------------------
  918.         - Adds support for XMS drivers.
  919.         - Reworks option switches.
  920.         - Supports DOS 2.x and 3.x programs that deallocate their
  921.           environment and place a smaller environment (containing
  922.           just the program name) in their own primary allocation block.
  923.         - Displays all selected primaries; previous versions would
  924.           display (e.g.) only the kernel if /k was selected.
  925.         - Fixes a problem that caused some deivces to show negative
  926.           sizes.
  927.  
  928.         Version 2.03
  929.         ------------
  930.         Fixes a problem in displaying disconnected high-memory chains
  931.         and resident programs loaded there.
  932.  
  933.         Version 2.02
  934.         ------------
  935.         - Fixes a problem with the "largest conventional free block".
  936.         - Fixes problems with sizes of certain device drivers.
  937.         - Fixes problem with stack size display when "STACKS=0,0".
  938.         - Doesn't show the DOS data area as "unallocated".
  939.         - Increases the maximum allowable number of files, buffers, and
  940.           FCBs to 255 each (from 100).
  941.         - Reduces chance of displaying spurious high memory chains.
  942.         - Displays name field of environment (/E switch) only if all
  943.           characters in the field are in the displayable ASCII range
  944.           (33..127).
  945.         - Displays name field in raw display only if the field contains
  946.           an 8-character, blank-filled, displayable ASCII string, and
  947.           only if the block owns itself (implying that it's a program).
  948.         - Shows segment address of environment (/E switch).
  949.  
  950.         Version 2.01 (6/7/90)
  951.         ---------------------
  952.         Fixes a problem that prevented PMAP from working on systems
  953.         with no expanded memory.
  954.  
  955.         Version 2.00 (6/5/90)
  956.         -----------------------
  957.         - Attempts to identify disconnected high-RAM chains
  958.         - Adds /F (files) option
  959.         - Adds /E (environment) option
  960.         - Adds /K (kernel display) option and identifies areas of the
  961.           DOS data block used for files, buffers, stacks, etc.
  962.         - Adds /Q (quick display) option
  963.         - Supports permanent options via PMAP variable
  964.         - Correctly reports size of last installed device driver
  965.         - Supports altered switch characters
  966.         - Shows program name in raw display if available from
  967.           environment.
  968.         - Uses correct number of available file handles with extended
  969.           handle tables (old versions assumed 20 handles)
  970.  
  971.         Version 1.34 (11/15/88)
  972.         -----------------------
  973.         Fixes a bug in 1.33 for resident programs that release their
  974.         environments under DOS 4.0.
  975.  
  976.         Version 1.33 (11/14/88)
  977.         -----------------------
  978.         Uses a new feature of DOS 4.0 to more reliably obtain names of
  979.         resident programs, including those installed via INSTALL.
  980.  
  981.         Version 1.31/1.32 (7/29/88)
  982.         ---------------------------
  983.         Displays number of open handles for each PSP.
  984.         Displays sizes of some devices (/V switch).
  985.         Improved display when too many vectors to fit on one line.
  986.         Fixed spurious errorlevel returned by successful run (32).
  987.  
  988.         Version 1.30
  989.         ------------
  990.         Adds /X, /S, and /? switches.
  991.         Adds device driver display (/V).
  992.         Displays names of EMS-users when available (LIM 4.0 only).
  993.         Allows wildcards in program-list.
  994.         Fixes problem with name of secondary copies of COMMAND.COM
  995.             under DOS 3.3 (it's not available).
  996.  
  997.         Version 1.26
  998.         ------------
  999.         Corrects a problem detecting extended memory with certain
  1000.         versions of BIOS ROM.
  1001.  
  1002.         Version 1.25
  1003.         ------------
  1004.         Adds the extended memory display and the selective display
  1005.         option.
  1006.  
  1007.         Corrects a minor problem with DOS 3.3.
  1008.  
  1009.         Version 1.21
  1010.         ------------
  1011.         Bug fixes to version 1.20:
  1012.  
  1013.         1. No more runaway display when EMS memory is present but none
  1014.         of it is in use.
  1015.  
  1016.         2. PMAP is more careful about what it thinks is the name of the
  1017.         command shell.
  1018.  
  1019.  
  1020.         Copyright/License/Warranty
  1021.         --------------------------
  1022.         This document and the program file PMAP.EXE ("the software") are
  1023.         copyrighted by the author.  The copyright owner hereby licenses
  1024.         you to: use the software; make as many copies of the program and
  1025.         documentation as you wish; give such copies to anyone; and
  1026.         distribute the software and documentation via electronic means.
  1027.         There is no charge for any of the above.
  1028.  
  1029.         However, you are specifically prohibited from charging, or
  1030.         requesting donations, for any such copies, however made; and
  1031.         from distributing the software and/or documentation with
  1032.         commercial products without prior permission.  An exception is
  1033.         granted to not-for-profit user's groups, which are authorized to
  1034.         charge a small fee (not to exceed $7) for materials, handling,
  1035.         postage, and general overhead.  NO FOR-PROFIT ORGANIZATION IS
  1036.         AUTHORIZED TO CHARGE ANY AMOUNT FOR DISTRIBUTION OF COPIES OF
  1037.         THE SOFTWARE OR DOCUMENTATION, OR TO INCLUDE COPIES OF THE
  1038.         SOFTWARE OR DOCUMENTATION WITH SALES OF THEIR OWN PRODUCTS.
  1039.  
  1040.         THIS INCLUDES A SPECIFIC PROHIBITION AGAINST FOR-PROFIT
  1041.         ORGANIZATIONS DISTRIBUTING THE SOFTWARE, EITHER ALONE OR WITH
  1042.         OTHER SOFTWARE, AND CHARGING A "HANDLING" OR "MATERIALS" FEE OR
  1043.         ANY OTHER SUCH FEE FOR THE DISTRIBUTION.  NO FOR-PROFIT
  1044.         ORGANIZATION IS AUTHORIZED TO INCLUDE THE SOFTWARE ON ANY MEDIA
  1045.         FOR WHICH MONEY IS CHARGED.  PERIOD.
  1046.  
  1047.         There is no restriction on the use of this software in
  1048.         commercial or institutional environments.
  1049.  
  1050.         No copy of the software may be distributed or given away without
  1051.         this document; and this notice must not be removed.
  1052.  
  1053.         There is no warranty of any kind, and the copyright owner is not
  1054.         liable for damages of any kind.  By using this free software,
  1055.         you agree to this.
  1056.  
  1057.         The software and documentation are:
  1058.  
  1059.                     Copyright (C) 1986, 1987, 1988, 1990 by
  1060.                             Christopher J. Dunford
  1061.                             The Cove Software Group
  1062.                                  P.O. Box 1072
  1063.                            Columbia, Maryland 21044
  1064.  
  1065.                                 (301) 992-9371
  1066.                         CompuServe 76703,2002 [IBMNET]
  1067.